from flask import Flask
from apps.common import bp as common_bp
from apps.cms import  bp as cms_bp
from apps.front import bp as front_bp
from apps.ueditor import bp as ueditor_bp
from apps.cms import models
from exts import  db,mail,alidayu,ckeditor
from flask_wtf import CSRFProtect

import config

app = Flask(__name__)
app.config.from_object(config)
db.init_app(app)
mail.init_app(app)
alidayu.init_app(app)
ckeditor.init_app(app)
CSRFProtect(app)

#/config/exts/manage/models/forms

#models拆分： 前台 后台、公共



app.register_blueprint(cms_bp,url_prefix="/cms")
app.register_blueprint(common_bp,url_prefix="/common")
app.register_blueprint(front_bp,url_prefix="/front")
app.register_blueprint(ueditor_bp)

@app.route('/')
def hello_world():
    return 'Hello World!'


if __name__ == '__main__':
    app.run()
